package com.xyy.saas.payment.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.xyy.elasticjob.client.annotation.ElasticJobConf;
import com.xyy.saas.payment.service.job.BalanceMonitorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 每天下午四点推送开户状态至企业微信监控
 */
@ElasticJobConf(name = "xyy.elastic.job.manage.OpenAccountStatusPushJob", cron = "0 0 11,16 * * ?")
@Slf4j
public class OpenAccountStatusPushJob implements SimpleJob {
    @Autowired
    private BalanceMonitorService balanceMonitorService;

    @Override
    public void execute(ShardingContext shardingContext) {
        long time = System.currentTimeMillis();
        balanceMonitorService.sendOpenAccountStatusToQiyeWx();
        long checkEndTime = System.currentTimeMillis();
        log.info("OpenAccountStatusPushJob#execute shardingInfo:{}", "cost time :" + (checkEndTime-time));
    }

}